package com.modai.springcloud.Service.impl;

import com.modai.springcloud.Service.AccountService;
import com.modai.springcloud.dao.AccountDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author ：modai
 * @date ：Created in 2020-12-21 12:05
 * @description：
 */
@Service
@Slf4j
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountDao accountDao;

    @Override
    public void decrease(Long userId, BigDecimal money) {
        log.info("扣减余额开始");
        accountDao.decrease(userId, money);
        log.info("扣减成功，扣除：{}", money);
    }
}
